import request from '@/utils/request'
import qs from 'qs'
import type{resweather24data,resweatherdata,resqualitydata} from './type'
export function getWeatherData(key: string):Promise<resweatherdata> {
  const data = {
    key
  }
  const requestData = qs.stringify(data)
  const url = `/get/weatherdata?${requestData}`
  return request({
    url: url,
    method: 'get'
  })
}

export function getWeather24Data(key: string):Promise<resweather24data> {
  const data = {
    key
  }
  const requestData = qs.stringify(data)
  const url = `/get/weather24data?${requestData}`
  return request({
    url: url,
    method: 'get'
  })
}

export function getqualitydata(key: string):Promise<resqualitydata>  {
  const data = {
    key
  }
  const requestData = qs.stringify(data)
  const url = `/get/qualitydata?${requestData}`
  return request({
    url: url,
    method: 'get'
  })
}
